package connect;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class MyConnect {
	private Connection con;
	
	
	public MyConnect(){
		
	}
	public Connection getConnect(){
		try {
			Class.forName("com.mysql.jdbc.Driver");
			return DriverManager.getConnection("jdbc:mysql://localhost:3306/jp06com_data", "root", "admin");
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;
	}
	
	
	
	
	public static void main(String args[]){
		
		MyConnect mc = new MyConnect();
		if(mc.getConnect()!=null){
			System.out.print("co ket noi");
		}else{
			System.out.print("k ket noi");
		}
	}
}
